1. processing and sorting machine generic device integration 1

回到我们的机器项目,我们实际上可以开始实现它,这是我们在过去几个视频中开发的通用设备,以便真正让机器以更加模块化的方式运行。
Getting back to our machine project, we can actually start implementing it, the generic device that we developed in the last few videos in order to actually get the machine running in an even more modular way.

因此,对于初学者来说,让我们从我们开发的项目中复制通用设备,以便他们实际上将产品中的通用设备文件夹从我们在早期视频中使用的项目复制到 The Machine 项目中,以便获得功能块和正在使用的所有数据类型。
So for starters, let's copy the generic device from the project that we developed them so that they're actually copy the generic device folder from the product, from the project we used in the earlier videos into the The Machine project in order to have the function blocks and all the data types that are being used.

好的,现在我们需要开始,嗯,我们需要开始,呃,看看我们需要开始看看我们的机器上有哪些通用设备以及它们属于哪个站。
OK, so now we need to start, um, we need to start, uh, to see we need to start to see which are the generic devices that we have here on our machine and what station they belong to.

因此,为了做到这一点,让我们创建一个全局变量列表,在其中放置所有通用设备。
So in order to do this, let's create a global variable list in which we will place all our generic devices.

因此,我们将在此处将此称为 GEVALT 下划线通用设备,我们将删除限定的唯一属性,我们将开始查看哪些设备,然后我们将实际看到我们的类型是什么。
So we will call this GEVALT underscore generic devices that will be here and we will remove the qualified only attribute and we will start looking at which are the devices and then we will actually see what our what is our type.

那么我们就从这里的提取站开始吧。
So let's start from the extraction station here.

我们只有 Beston 设备,因此我将在新创建的全局变量列表中创建一个活塞设备变量,并且类型将是通用设备。
We only have the Beston device, so I will create a piston device variable in our new newly created a global variable list and the type will be be generic device.

然后对于提取,我们就很好了。
Then for the extraction, we are good.

继续前进,我们实际上有两个设备。
Moving on to the level, we have actually two devices.

我们有杠杆,所以我会写任何设备,并且类型是相同的设备。
We have the lever, so I will write whatever device and the type is the same device.

我们还有夹具。
And also we have the gripper.

因此,我将尝试调平夹具,该类型再次是通用设备,我们可以简单地为我们所有的设备复制并粘贴此部分。
So I will try to level gripper and the type is, again, a generic device and we can simply copy and paste this part for our all of our devices.

然后继续前进,我们有电梯。
Then moving on, we have the elevator.

很抱歉,我们将有一个 or 设备,以便与我用电梯设备编写的内容保持一致,类型相同。
So sorry, we'll have a or device in order to be consistent with what I wrote with the elevator device, the same type.

然后继续,我们有真正的运动,管理真实运动的设备,真正的运动设备。
Then moving on, we have the real movement, the device that manages the real movement, so real movement device.

钻头驱动装置,所以是真正的驱动装置。
The drill actuation device, so real actuation device.

然后我们有空气驱动装置,虎钳。
Then we have the air actuation, the vice.

我总是在末尾添加 ,以便将执行器变量与通用设备区分开来。
I always adding the at the end, in order to distinguish the the, um, the actuator variable from the generic device.

然后我们就有了表表设备。
Then we have the table table device.

最后一个到桌子上,夹钳,虎钳。
And the last to the table, griper, the vice.

让我们在这里添加一些注释来区分该站,以便大家,对,提取站设备。
Let's add a few comments here to distinguish the station so everyone, right, extraction station devices.

我们只提供适合天气的 Beston。
We only have the Beston for the weather.

我们有更高级别的站设备。
We have a higher level station devices.

这里我们有电梯电梯站设备。
Here we have the elevator elevator station devices.

钻井站设备。
Drilling station devices.

上周,我有了桌子台站设备。
And last week, I have the table table station devices.

所以我,嗯,实际上喜欢做的事情,我们可以通过很多不同的方式来做到这一点。
So what I, um, actually like to do, we can do this in many different ways.

我们实际上可以在任何一个内拨打电话。
We could actually have a call within any of the.

站保护自己的通用设备,或者我们可以在主程序中调用所有通用设备,我的意思是,这对我们来说是完全相同的。
The stations to guard its own generic devices, or we could have a call in the main program calling all the generic devices, I mean, it is quite the same for us.

那么让我们在主程序中执行此操作。
So let's do this in the main program.

所以在这里,我们有,呃,车站电话和。
So over here, we have, uh, the station call and.

在站调用之后,我将添加一个名为的通用设备,因此我将创建一个动作和一个视频,这将是我们的通用设备 devices。
After the station call, I will add a generic device called So I will create an action and a video and this will be our generic device devices called.

我会把它放在领子的正下方,仿制药的正下方,即车站呼叫。
And I will place this right below the collar, right below the generics, the station call.

对不起。
Sorry.

让我们更改名称以使其更好,称为下划线操作。
Let's change the name in order to make it good here and is called underscore action.

进行重构的流程也会发生变化。
Process to carry out the refactoring that will change also.

我在哪里称呼它。
Where I called it.

好的,所以我们需要将调用写入我们所有的设备,我将在今年打开。
OK, so we need to write the call to all our devices and I will open this year.

您需要添加呼叫。
You need to add the call.

其中之一是我们将在其中配置实际设备的任何设备。
One called for any devices in which we will be configuring the actual device.

那么让我们从这里的Beston开始吧。
So let's start from the Beston here.

我们将有活塞装置。
We will have the piston device.

我们有很多事情要做,需要设法配置。
We have quite a few things to do, manage to configure.

让我们删除你的。
Let's remove your.

都是问号。
All the question marks.

让我们为所有设备复制此内容,以便我们知道每个级别的设备,复制和粘贴。
And let's copy this for all the devices so we know that every level of device, copy and paste.

对不起。
I'm sorry.

我们将会有一个夹爪装置的信徒,夹爪装置。
We will have a believer in griper device, griper device.

复制和粘贴。
Copy and paste.

我们将有一个电梯装置。
We will have an elevator device.

真正的运动,恶习。
The real movement, the vice.

真正的激活装置,空气激活装置,他们快完成了。
The real activation device, the air activation device, they're almost done.

桌子,最后是桌子夹子、虎钳。
The table and lastly, the table griper, the vice.

所以我们。
So we.

成功实例化了我们所有的设备。
Managed to instantiate all of our devices.

现在我们需要配置它们。
Right now we need to configure them.

我们创建了不同的输入,以便配置我们正在使用的设备类型。
We we created the different inputs in order to configure what type of device we are using.

那么让我们来看看这个。
So let's look into this.

让我们从活塞开始。
Let's start from the piston here.

例如,活塞,我们实际上只有一个驱动来使其向前移动,因此我们可以在这里写为单个驱动。
For instance, the piston, we actually have only a single actuation to move it forward so we can write here single actuation.

这个单一指控应放在这里,所以没错,单击并按插入分配,这应该是基于移动并向前移动。
And this single accusation shall be placed here, so that's right, click and press insert assignment and this should be move based and forward.

这里对于活塞来说,我们实际上只有一个传感器,告诉我们活塞在哪里,活塞在哪里,这个传感器就在这儿。
Here for the Pistons, we actually have only one sensor that tells us where the piston is, where the piston, the this sensor over here.

还有两个传感器告诉我们是否有产品,在我看来,这些不是与设备相关的传感器,而是与机器相关,因为它们不会告诉我们活塞是否在哪里,但如果有这里有一个产品。
And two sensors that tells us if there is a product, this, in my opinion, these are not sensor related to the device, but they are related to the machine because they do not tell us if where is the piston, but if there is a product here.

所以活塞可以向前或向后,我们可以在这里或这里有产品。
So the piston could be forward or backward and we could have products here or here.

因此,这些传感器将用于机器的逻辑,但不用于管理设备本身。
So they these sensors will be used for the logic for the machine, but not for the to manage the device itself.

因此,活塞将是单个禁用反馈,该反馈是因为我们只有一个传感器,该传感器会告诉我们设备何时禁用,并且该传感器将放置在这里,并且是活塞起始位置传感器。
So the piston will be a single that single disable feedback, the feedback because we are only one sensors, the sensor that will tell us when the device is disabled and this sensor will be placed here and is the piston start position sensor.

因此,每当我单击 control 和 space 时,都会添加命名空间。
So whenever I click control and space, the namespace will be added.

我们可以将其删除,嗯,以获得更轻松的含义,我们实际上需要为活塞添加激活时间。
We can remove it to be, um, to have a lighter connotation and we actually need to add an activation time for the piston.

所以说是这样的。
So that's right.

目前。
For now.

两者都需要五秒钟,他问道,请花五秒钟。
Five seconds for both, he asked, take five seconds.

因此,激活实际上将用于检测以控制设备。
So this the activation would be actually used to detect to for controlling the device.

因此,五秒后或当设备启用时,设备将发出信号,表明它实际上已启用激活时间,因为我们有一个传感器,因此将用于检测。
So after five seconds or when the device is enabled, the device will signal that it is actually enabled the activation time instead, that since we have a sensor, will be used for for the detection.

因此,我们将能够查看传感器或激活是否出现问题。
So we will be able to see if something is going wrong with us, with the sensor or the activation.

好的,让我们继续讨论杠杆,杠杆又是一个单一的致动,所以我写了一个单一的致动,而致动器就是移动杠杆。
OK, so let's move on to the lever, the lever again is a single actuation, so I write a single actuation and the actuator is the move lever right then.

移动皮革很有价值,对吗?
Valuable move leather, right?

然后我们看看脚上的传感器,因为水平仪、反馈,我们有两个传感器,一个告诉我们水平仪是水平的,另一个告诉我们水平仪是正确的。
Then we have the let's look at the sensors at the feet because of the level, the feedback, we have two sensors, one that tells us that the level is level and one that tells us that the level is right.

因此,我们将有一个双重反馈,其中禁用的传感器将水平向左,水平向左水平,位置传感器和启用的传感器将水平向右位置传感器。
So we will have a double feedback in which the disabled sensor will be level left, the level left level left, the position sensor and the enabled sensor will be level right position sensor.

让我们为激活和激活添加一些时间。
And let's add some times for the activation and the activation.

现在,五秒钟。
And right for now, five seconds.

好的,那么我们的抓手本身就是一个设备,即使它看起来只是一个简单的布尔变量,我们实际上没有反馈,因为我们将激活它,并且我们没有任何传感器告诉我们它是否实际上已被激活。
OK, then we have the griper that is a device itself, even if it seems just like a simple boolean variable, we actually have no feedback because we will activate it and we do not have any sensor that tells us if it actually has been activated.

所以没有反馈。
So no feedback.

我们将两次使用它来控制设备。
We will use that both times for the control of the device.

让我们在这里停留很短的时间。
So let's right here a very short time.

让我们说点一秒钟。
Let's say point one seconds.

主题标签指向一秒钟。
The hashtag point one seconds.

在这里,我们也需要查看方程,这是亚洲设备的单个方程,所以我们在这里给变量赋值,即水平夹具执行器。
And here as well, then we needed to look at the equation and this is a single equation to Asian device, so let's have an assignment here to the variable, which is the level gripper actuator.

好的,那么继续,我们有电梯,电梯是最完整的设备之一,所以我们将有双重反馈,反馈和双重激活,因为我们必须有一个传感器来告诉我们电梯何时被禁用的位置。
OK, so moving on, we have the elevator, the elevator is one of the most complete devices, so we will have a double feedback, feedback and double activation because we have to sensor one that tells us where when the elevator is disabled.

那么电梯按钮传感器对于我们来说又是怎样的呢?
So the elevator button sensor for us and.

我们有电梯顶部传感器。
We have the elevator top sensor.

我们必须启动,所以我们在这里将启用启动启动,因为我们实际上可以用两种方式解释电梯,我们可以认为底部的电梯是禁用的,顶部的电梯是启用的,反之亦然。
We have to actuation, so we will have here the enable actuation, since we actually can interpret the elevator in two ways, we can think of elevator at the bottom as disabled and at the top as enabled or vice versa.

我们可以认为电梯在顶部为禁用状态,在底部为启用状态。
We can think that the elevator is on top as disabled and on the bottom as enabled.

它的工作方式与您只需在启用和禁用之间切换即可。
It works in the same way what you simply need to switch between the enabling and disabling.

但是,呃,现在,我使用底部作为禁用状态,顶部作为启用状态的约定。
But, uh, here for now, I use the convention of using bottom as disabled and top as enabled.

因此,启用的设备激活将向上移动电梯,而设备执行器、禁用设备执行器将向下移动电梯。
So the enabled device activation will be the move elevator up while the device actuator, the disable device actuator will be the move elevator down.

好吧,我们需要的激活时间非常慢。
OK, and the activation time, let's say, that we need it is quite slow.

所以前六秒抱歉,我写了一些奇怪的东西,六秒和前六秒。
So the first six seconds sorry, I wrote something weird, six seconds and the first six seconds.

好的,继续练习。
OK, moving on to the drill.

钻机与电梯非常相似,因为它是双反馈和双激活类型的设备。
The drill is quite similar to the elevator because it is a double feedback and double activation type of device.

和。
And.

我们实际上可以对电梯进行同样的推理,但我想以相反的方式进行,因为对于我们的机器来说,认为钻头在上升时被禁用并在它上升时启用实际上是有意义的。已下降。
We actually can do the same kind of reason reasoning here for the elevator, but I would like to do this in the opposite way because for our machine, it actually makes sense to think that the drill is disabled when it is up and enable when it is down.

所以我要做的就是做与电梯相反的事情。
So what I will do is do the opposite of the elevator.

因此,四小时的钻探,当钻头低于真实底部传感器时,钻头将被启用,而当钻头向上时,它将被禁用。
So the four hour drill, the drill will be enabled when it is down the real bottom sensor and it will be disabled when the drill is up.

钻孔传感器。
Drill sensor.

和。
And.

让我们,呃,请这是一个四秒的时间线。
Let's, uh, please here's a timeline of, let's say, four seconds.

好的,那么我们需要签署声明。
OK, then we need to sign the declaration.

我们通过向下移动钻取来启用它,因为启用意味着向下移动钻取并向上移动以禁用它。
We have the move drill down to enable it, because enabled means moving down for the drill and moved up to disable it.

好的,我们快完成了,我们还有一些设备。
OK, we are almost done and we have a few more devices.

钻井站是比其他任何一个站拥有更多设备的站。
The drilling station is the one that has more devices than any of the other stations.

因此,我们必须进行与没有反馈的夹具非常相似的钻孔激活。
So we have to drill activation that is quite similar to the gripper that is was a no feedback.

并且单次致动。
And single actuation.

因此,在这里我们需要一段时间,或者您将放置一些时间,直到我们实际上可以从关卡组中复制所有内容,并且执行插入分配。
So here we will need a time or you will place the words little time until we can actually copy everything here from the level group and the actuation is insert assignment.

是真实的驱动变量。
Is the real actuation variable.

空气驱动也是如此,并且在非常短的时间内没有反馈单次驱动。
The same goes for the air actuation that is as well, and no feedback single actuation with a very small time.

我们将分配的变量是空气激活亚洲变量。
And the variable that we will assign is the air activation Asian variable.

然后我们有桌子和,嗯,夹具,所以桌子是一个相当棘手的设备,因为这似乎有点违反直觉。
Then we have the table and the, um, the griper, so the table is quite a tricky device because it is this seems kind of counterintuitive because.

在这里,我们可以将桌子视为一种设备,在移动时启用,在静止时禁用,并且在这种想法中,桌子是无反馈设备,因为我们实际上没有桌子正在移动的反馈。
Here we can think of the table as a device that is enabled when it is moving and disabled when it is still and in this kind of thinking that the table is a no feedback device because we have actually no feedback that the table is moving.

我们可能通过传感器知道它,但实际上我们不知道它何时移动或静止。
We may know it from the sensors, but we actually don't know when it is moving or not.

我们有一个单一的激活。
And we have a single activation.

这就是我们将在这里分配的移动表。
That is the move table that we will assign here.

没有表,激活和激活时间应该很小,因为启动它需要一点时间。
No table and the activation and the activation time should be quite small because it takes a little bit to start it.

桌子上的抓手也是如此,所以没有反馈,因为这与皮革的抓手非常相似。
And the same goes for the gripper on the table, so no feedback there because this is quite similar to the griper of the leather.

也有非常小的时候。
And very small times as well.

事实上,不,对不起,我们需要更长的时间,因为我们说过,当一个产品被丢弃时,我们需要几秒钟来启动它,真正释放它,这样这个激活,激活时间就派上用场了我们。
Actually, no, sorry, we need a bigger time because we said that there are when a product is being dropped, we need a few seconds to start it, to actually release it so that this activation, the activation times comes come in handy for us.

让我们将作业添加到表中。
And let's add the assignment to the table.

夹具变量。
Griper variable.

好的,我们设法在这里为所有设备编写调用。
OK, so we manage to write the call for all of our devices here.

这意味着我们将不再与这些传感器和执行器、我们状态中的变量、车站的机器交互,我们将只与设备交互。
This means that we will no longer interact with this sensors and actuators, variables in our state, machines of the stations, we will just interact with the devices.

这非常重要,因为如果您开始在此处使用变量,它就违背了使用通用接口的目标,在接下来的三天中,我们将开始查看站点并实现遵循此通用哲学设备的逻辑。
This is very important because if you start using the variable here, it kind of defeats the goal of using a generic interface and in the next three days we will start looking at the stations and implement the logic that follows this generic device of philosophy.